package com.example.nacosconfigspringbootdemo.controller;

import com.alibaba.nacos.api.config.annotation.NacosValue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    @NacosValue(value = "${nacosuser.name}",autoRefreshed = true)
    private String userName;
    @Value("${user.address}")
    private String address;


    @GetMapping("/hello")
    public String hello(){
        return userName+ address;
    }
}
